﻿
#region Comment

/*
 * Project：    SpaceLibrary
 * 
 * FileName:    Option/series.cs
 * CreatedOn:   2016-06-23
 * CreatedBy:   农夫有田
 * 
 * 
 * Description：
 *      ->      ECharts3全局参数
 *   
 * History：
 *      ->
 * 
 * Examples：
 *      ->      
 *          
 */

#endregion

namespace SpaceLibrary
{
    using System;
    using System.Collections.Generic;

    #region 全局参数

    /// <summary>
    /// 全局参数
    /// </summary>
    public partial class ECharts3
    {
        #region series

        /// <summary>
        /// 系列列表。每个系列通过 type 决定自己的图表类型
        /// </summary>
        public List<_series> series = new List<_series>();

        public class _series
        {
            #region type

            private Enum.seriesType _type = Enum.seriesType.line;

            /// <summary>
            /// 图表类型
            /// <para>[ default: 'line' ]</para>
            /// </summary>
            public Enum.seriesType type
            {
                get { return _type; }
                set { _type = value; }
            }

            /// <summary>
            /// 图表类型
            /// </summary>
            public string seriestype
            {
                get
                {
                    string __type = Params.seriesType.line;
                    switch (_type)
                    {
                        case Enum.seriesType.line:
                            __type = Params.seriesType.line;
                            break;
                        case Enum.seriesType.bar:
                            __type = Params.seriesType.bar;
                            break;
                        case Enum.seriesType.pie:
                            __type = Params.seriesType.pie;
                            break;
                        case Enum.seriesType.scatter:
                            __type = Params.seriesType.scatter;
                            break;
                        case Enum.seriesType.effectScatter:
                            __type = Params.seriesType.effectScatter;
                            break;
                        case Enum.seriesType.radar:
                            __type = Params.seriesType.radar;
                            break;
                        case Enum.seriesType.treemap:
                            __type = Params.seriesType.treemap;
                            break;
                        case Enum.seriesType.boxplot:
                            __type = Params.seriesType.boxplot;
                            break;
                        case Enum.seriesType.candlestick:
                            __type = Params.seriesType.candlestick;
                            break;
                        case Enum.seriesType.heatmap:
                            __type = Params.seriesType.heatmap;
                            break;
                        case Enum.seriesType.map:
                            __type = Params.seriesType.map;
                            break;
                        case Enum.seriesType.parallel:
                            __type = Params.seriesType.parallel;
                            break;
                        case Enum.seriesType.lines:
                            __type = Params.seriesType.lines;
                            break;
                        case Enum.seriesType.graph:
                            __type = Params.seriesType.graph;
                            break;
                        case Enum.seriesType.sankey:
                            __type = Params.seriesType.sankey;
                            break;
                        case Enum.seriesType.funnel:
                            __type = Params.seriesType.funnel;
                            break;
                        case Enum.seriesType.gauge:
                            __type = Params.seriesType.gauge;
                            break;
                        default:
                            __type = Params.seriesType.line;
                            break;
                    }
                    return __type;
                }
            }

            #endregion

            #region name

            private string _name = string.Empty;

            /// <summary>
            /// 系列名称
            /// </summary>
            public string name
            {
                get { return _name; }
                set { _name = value; }
            }

            #endregion

            #region itemStyle

            /// <summary>
            /// 折线拐点标志的样式。
            /// </summary>
            public _itemStyle itemStyle = new _itemStyle();

            /// <summary>
            /// 折线拐点标志的样式。
            /// </summary>
            public class _itemStyle : absItemStyle
            {

            }

            #endregion

            #region lineStyle

            /// <summary>
            /// 线条样式。
            /// </summary>
            public _lineStyle lineStyle = new _lineStyle();

            /// <summary>
            /// 线条样式。
            /// </summary>
            public class _lineStyle : absLineStyle
            {

            }

            #endregion

            #region data

            private List<dataList> _datalist = new List<dataList>() { };

            /// <summary>
            /// 系列中的数据内容数组
            /// </summary>
            public List<int> data
            {
                get
                {
                    List<int> _data = new List<int> { };
                    foreach (dataList d in _datalist)
                    {
                        _data.Add(d.value);
                    }
                    return _data;
                }
                set
                {
                    foreach (int d in value)
                    {
                        _datalist.Add(new dataList { value = d });
                    }
                }
            }

            /// <summary>
            /// 系列中的数据内容数组
            /// </summary>
            public List<dataList> datalist
            {
                get { return _datalist; }
                set { _datalist = value; }
            }

            #region dataList

            /// <summary>
            /// 系列中的数据内容数组
            /// </summary>
            public class dataList
            {
                #region name

                private string _name = string.Empty;

                /// <summary>
                /// 数据项名称
                /// </summary>
                public string name
                {
                    get { return _name; }
                    set { _name = value; }
                }

                #endregion

                #region value

                private dynamic _value = string.Empty;

                /// <summary>
                /// 单个数据项的数值
                /// </summary>
                public dynamic value
                {
                    get { return _value; }
                    set { _value = value; }
                }

                #endregion

            }

            #endregion

            #endregion

        }

        #endregion
    }

    #endregion
}
